<%@ page import="by.home.ChatRoom" %>
<%@ page import="by.home.Parameters" %>
<%@ page import="java.util.Set" %>
<%@ page import="by.home.Message" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title></title>
</head>
<body>
<%
  Parameters parameters = (Parameters) request.getAttribute("params");

  ChatRoom chatRoom = parameters.getChatRoom();
  Set<Message> messages = chatRoom.getMessages();
%>

id: <%= chatRoom.getId()%><br>
header: <%= chatRoom.getHeader()%><br>
date: <%= chatRoom.getDate()%><br>

<%
  for (Message message : messages) {
%>
<div style="border: 1px solid grey; width: 500px; margin-left: 40px; margin-top: 10px; padding: 5px; display: block;">
  id: <%= message.getId()%> <br>
  author: <%= message.getAuthor().getNick()%> <br>
  content: <%= message.getContent()%> <br>
  date: <%= message.getDate()%> <br>
</div>
<%
  }
%>


</body>
</html>